<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->bigIncrements('id');        // 管理员的id
            $table->string('email')
                  ->unique()
                  ->index();                    // 管理员的登录邮箱
            $table->string('password');         // 管理员的登录密码
            $table->string('name');             // 管理员名称
            $table->timestamps();               // 创建和更新的时间
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
